﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace ebclang
{
    public class ToStreamable<T> where T : IStreamableElement, new()
    {
        public event Action<T> Result;
        public void Process(IEnumerable<T> sequence)
        {
            sequence
                .ToList()
                .ForEach(x => Result(x));
            Result(new T { StreamEnd = true });
        }

    }
}